package com.violet.uaa.server.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.violet.common.entity.Menu;
import com.violet.common.util.ObjectCopyUtil;
import com.violet.uaa.server.auth.dto.MenuDTO;
import com.violet.uaa.server.auth.mapper.MenuMapper;
import com.violet.uaa.server.auth.service.AuthService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: wqf
 * @Date: 2024/08/31
 * @Description:
 */
@Service
public class AuthServiceImpl implements AuthService {

    @Resource
    private MenuMapper menuMapper;

    /**
     * 方法描述: 查询登录用户的完整权限信息
     *
     * @return com.violet.uaa.server.login.entity.LoginUser
     * @author wqf
     * @date 2024/8/31 16:48
     */
    @Override
    public String getInfo() {
        return null;
    }

    /**
     * 方法描述: 查路路由信息
     *
     * @return java.util.List<com.violet.uaa.server.auth.dto.MenuDTO>
     * @author wqf
     * @date 2024/8/31 16:48
     */
    @Override
    public List<MenuDTO> getRouters() {
        List<Menu> menus = menuMapper.selectList(new LambdaQueryWrapper<>());
        return ObjectCopyUtil.copyListProperties(menus, MenuDTO::new);
    }
}
